package com.interview.core.page;

import java.util.List;

public class Page {
	private Integer pageIndex;
	private Integer pageSize = 10;
	private Integer total;
	private List list;
	private Integer totalPage;

	public Integer getTotalPage() {
		
		totalPage = total / pageSize;
		
		if (total % pageSize != 0) {
			totalPage = totalPage + 1;
		}

		if (totalPage <= 0) {
			totalPage = 1;

		}

		return totalPage;
	}

	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}

	public Integer getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}
}
